package net.mingsoft.document.biz.impl;

import net.mingsoft.dashboard.action.q.collection.CollectionCancelQuery;
import net.mingsoft.document.biz.FileStarBiz;
import net.mingsoft.document.dao.FileStarDao;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author gengfa
 * @date 22/02/10
 */
@Service
public class FileStarBizImpl implements FileStarBiz {

    @Resource
    FileStarDao fileStarDao;

    private static final String DELETED = "DELETED";

    @Override
    public boolean cancelStar(CollectionCancelQuery query) {
        return CollectionUtils.size(query.getIds()) == fileStarDao.updateStatus(query.getIds(), DELETED);
    }
}
